{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "be30f35b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\n",
       "[[-6.8995752e+00 -2.2081401e+00  7.9196773e-02  6.7098556e+00\n",
       "   7.0000000e+01]\n",
       " [-6.6761980e+00 -2.2081401e+00  7.9196773e-02  6.4805980e+00\n",
       "   4.0000000e+01]\n",
       " [-6.6761980e+00 -2.2081401e+00  7.9196773e-02  6.4805980e+00\n",
       "   5.0000000e+01]\n",
       " [-5.9222994e+00 -2.2081401e+00  7.9196773e-02  5.7068529e+00\n",
       "   5.0000000e+01]\n",
       " [-5.5872335e+00 -2.2081401e+00  7.9196773e-02  5.3629661e+00\n",
       "   5.0000000e+01]\n",
       " [-5.4476223e+00 -2.2081401e+00  7.9196773e-02  5.2196798e+00\n",
       "   3.0000000e+01]\n",
       " [-5.1404786e+00 -2.2081401e+00  7.9196773e-02  4.9044504e+00\n",
       "   3.5000000e+01]\n",
       " [-3.7443702e+00 -2.0391660e+00  7.9196773e-02  3.5002465e+00\n",
       "   5.0000000e+01]\n",
       " [-4.2748914e+00  1.0023720e+00  7.9196773e-02  4.5605640e+00\n",
       "   1.5500000e+02]\n",
       " [-4.0515141e+00  1.0023720e+00  7.9196773e-02  4.3313060e+00\n",
       "   2.0000000e+02]\n",
       " [-4.4703465e+00 -6.8737131e-01  7.9196773e-02  4.4745922e+00\n",
       "   4.0000000e+02]\n",
       " [-3.9119034e+00 -6.8737131e-01  7.9196773e-02  3.9014475e+00\n",
       "   4.0000000e+02]\n",
       " [-3.5489151e+00 -1.7012173e+00  7.9196773e-02  3.3569603e+00\n",
       "   1.4400000e+02]\n",
       " [-3.3813822e+00 -1.7012173e+00  7.9196773e-02  3.1850171e+00\n",
       "   1.5600000e+02]\n",
       " [-3.1300826e+00 -6.8737131e-01  7.9196773e-02  3.0990453e+00\n",
       "   3.3600000e+02]\n",
       " [-2.7391722e+00 -1.1473977e-02  7.9196773e-02  2.8124731e+00\n",
       "   3.7200000e+02]\n",
       " [-2.7391722e+00 -1.1473977e-02  7.9196773e-02  2.8124731e+00\n",
       "   3.7200000e+02]\n",
       " [-2.5437171e+00  1.5750036e-01  7.9196773e-02  2.6405296e+00\n",
       "   3.9000000e+02]\n",
       " [-2.4599507e+00  1.5750036e-01  7.9196773e-02  2.5545580e+00\n",
       "   3.9600000e+02]\n",
       " [-2.3482621e+00  3.2647467e-01  7.9196773e-02  2.4685864e+00\n",
       "   4.0100000e+02]]\n",
       "<NDArray 20x5 @cpu(0)>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "%matplotlib inline\n",
    "import d2lzh as d2l\n",
    "import xlrd\n",
    "import random\n",
    "import math\n",
    "from IPython import display\n",
    "from matplotlib import pyplot as plt\n",
    "from mxnet import autograd, nd\n",
    "import xlrd\n",
    "\n",
    "def excel2matrix(path):\n",
    "    data = xlrd.open_workbook(path)\n",
    "    table = data.sheets()[0]\n",
    "    nrows = table.nrows  # 行数\n",
    "    ncols = table.ncols  # 列数\n",
    "    datamatrix = nd.random.normal(scale=1,shape=(nrows, ncols))\n",
    "    for i in range(nrows):\n",
    "        rows = table.row_values(i)\n",
    "        datamatrix[i,:] = rows\n",
    "    return datamatrix\n",
    " \n",
    "pathX = '272rnn.xls'  #  113.xlsx 在当前文件夹下\n",
    "x =excel2matrix(pathX)\n",
    "x[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0f2d3663",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:gluon] *",
   "language": "python",
   "name": "conda-env-gluon-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
